//购物车配置
var defaults = {
	cookieFileName:"mycart",
	isCookie:true,
	orderBtnPrice:"price",		//购买按钮的price属性设置 
	orderBtnImg:"img",			//购买按钮的img属性设置 
	orderBtnClass:"buy_btn",	//用户必须设置的 ,响应添加到购物车的按钮用<a href="" class="order_btn" id="01" name="瓜子" price="5" img="#"></a>,属性需要设置,所有类名同一标志 e.g: 物品列表的购买按钮
	tipMessage:"您的购物车还是空的",
	doSubmit:function(cart){}
};

$(document).ready(function(){
	$("body").mycart(defaults);
	//add left border to the list_item which is the first one of its row 
	$("#page_list .list_item").addClass(function(){
		var index = $(this).index() + 1;
		if( index %4 == 1){
			return "list_item_leftborder";
		} else {
			return "";
		}
	});
	$("#order_type li").click(function(){
		var typeId = $(this).attr("id");
		var type ;
		//alert(typeId);
		if( typeId == "order_default"){
			
		} else if( typeId == "order_price" ){
			type = $("#type").val();
			if( type == "asc" ){
				$("#type").val("desc");
				$(this).children("b").addClass("order_mod_arrow_desc");
			} else {
				$("#type").val("asc");
				$(this).children("b").removeClass("order_mod_arrow_desc");
			}
		}
		$(this).addClass("selected");
		$(this).siblings().removeClass('selected');
	});
	$("#page_type li").click(function(){
		var typeId = $(this).attr("id");
		var type ;
		//alert(typeId);
		if( typeId == "prev"){
			//prev
			alert("prev");
		} else if( typeId == "next" ){
			//next
			alert("next");
		}
		$(this).addClass("selected");
		$(this).siblings().removeClass('selected');
	});
	$(".list_item").mouseover(function() {
		$(this).children(".item_info").children(".wrap_btn").addClass("wrap_btn_show");
	}).mouseleave(function() {
		$(this).children(".item_info").children(".wrap_btn").removeClass("wrap_btn_show");
	});
});
//load list by ajax
function loadListByAjax(pageNo,orderType,asc_desc){
	
}
